package com.hhe.datax_transfer.controller;

import com.hhe.datax_transfer.common.JsonResult;
import com.hhe.datax_transfer.common.ReceiptDefine;
import com.hhe.datax_transfer.model.GenerateModel;
import com.hhe.datax_transfer.service.GenerateOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 生成控制层
 *
 * @author HHe
 * @version V1.0
 * @date 2021/2/2 20:20
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/transfer/generate")
public class GenerateController {
    @Autowired
    private GenerateOperation generateOperation;
    /**
     * 简单生成
     *
     * @version V1.0
     * @author HHe
     * @date 2021/2/2 20:21
     */
    @RequestMapping(value = "/easygenerate", method = RequestMethod.POST)
    public JsonResult easyGenerate(@RequestBody GenerateModel generateModel) {
        return new JsonResult("200", ReceiptDefine.SELECT_SUCC, generateOperation.easyGenerate(generateModel));
    }
}
